import request from '@/utils/request'

// 编辑详情
export function getFindById(id) {
  return request.get('/pickCar/findById/' + id)
}

// 删除
export function deleteById(id) {
  return request.delete('/pickCar/del/' + id)
}

// 详情
export function getDetail(id) {
  return request.get('/pickCar/detail/' + id)
}

// 确认转工单
export function confirmTurnOrder(id, orderTypeDictId) {
  return request.get('/pickCar/confirmTurnOrder' + id + '/' + orderTypeDictId)
}

//获取分页数据 
export function page(form, pageSize, currentPage) {
  return request.post('/pickCar/page', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}

// 生成工单编号
export function getWorkOrderCode() {
  return request.get('/pickCar/getWorkOrderCode')
}

//新增 
export function add(form) {
  return request.post('/pickCar/save', form)
}

//修改
export function update(form) {
  return request.put('/pickCar/save', form)
}

// 转工单
export function turnOrder(id) {
  return request.get('/pickCar/turnOrder/' + id)
}

// 内部检测项分页
export function checkProjectPage(form, pageSize, currentPage) {
  return request.post('/checkProject/page', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}

// 设置为常用检测项 
export function frequently(form) {
  return request.post('/checkProject/frequently', form)
}

// 保存检测项 
export function checkProjectAdd(form) {
  return request.post('/checkProject/save', form)
}